#!/usr/bin/env python3
# vim: set fileencoding=utf-8

"""Constants used in pywifi library define here."""

# Define interface status.
IFACE_DISCONNECTED = 0
IFACE_SCANNING = 1
IFACE_INACTIVE = 2
IFACE_CONNECTING = 3
IFACE_CONNECTED = 4

# Define auth algorithms.
AUTH_ALG_OPEN = 0
AUTH_ALG_SHARED = 1

# Define auth key mgmt types.
AKM_TYPE_NONE = 0
AKM_TYPE_WPA = 1
AKM_TYPE_WPAPSK = 2
AKM_TYPE_WPA2 = 3
AKM_TYPE_WPA2PSK = 4
AKM_TYPE_UNKNOWN = 5

# Define ciphers.
CIPHER_TYPE_NONE = 0
CIPHER_TYPE_WEP = 1
CIPHER_TYPE_TKIP = 2
CIPHER_TYPE_CCMP = 3
CIPHER_TYPE_UNKNOWN = 4

KEY_TYPE_NETWORKKEY = 0
KEY_TYPE_PASSPHRASE = 1

status_dict = [
    IFACE_INACTIVE,
    IFACE_CONNECTED,
    IFACE_CONNECTED,
    IFACE_DISCONNECTED,
    IFACE_DISCONNECTED,
    IFACE_CONNECTING,
    IFACE_CONNECTING,
    IFACE_CONNECTING
]

auth_value_to_str_dict = {
    AUTH_ALG_OPEN: 'open',
    AUTH_ALG_SHARED: 'shared'
}

auth_str_to_value_dict = {
    'open': AUTH_ALG_OPEN,
    'shared': AUTH_ALG_SHARED
}

akm_str_to_value_dict = {
    'NONE': AKM_TYPE_NONE,
    'WPA': AKM_TYPE_WPA,
    'WPAPSK': AKM_TYPE_WPAPSK,
    'WPA2': AKM_TYPE_WPA2,
    'WPA2PSK': AKM_TYPE_WPA2PSK,
    'OTHER': AKM_TYPE_UNKNOWN
}

akm_value_to_str_dict = {
    AKM_TYPE_NONE: 'NONE',
    AKM_TYPE_WPA: 'WPA',
    AKM_TYPE_WPAPSK: 'WPAPSK',
    AKM_TYPE_WPA2: 'WPA2',
    AKM_TYPE_WPA2PSK: 'WPA2PSK',
    AKM_TYPE_UNKNOWN: 'OTHER'
}

cipher_str_to_value_dict = {
    'NONE': CIPHER_TYPE_NONE,
    'WEP': CIPHER_TYPE_WEP,
    'TKIP': CIPHER_TYPE_TKIP,
    'AES': CIPHER_TYPE_CCMP,
    'OTHER': CIPHER_TYPE_UNKNOWN
}

cipher_value_to_str_dict = {
    CIPHER_TYPE_NONE: 'NONE',
    CIPHER_TYPE_WEP: 'WEP',
    CIPHER_TYPE_TKIP: 'TKIP',
    CIPHER_TYPE_CCMP: 'AES',
    CIPHER_TYPE_UNKNOWN: 'UNKNOWN'
}